This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
RE: copy document with responses to another database ~Lily Nonwetherjip 27.Jan.04 11:15 AM a Web browser Domino Designer 6.0.1 CF1All Platforms
Extract from the help:
These two scripts work together to place the currently open document (in the user interface) and its responses, including all responses-to-responses, in a folder. The first script is a form action script that the user can activate from a document on the workspace. It gets doc, the document on disk that corresponds to the currently open document, and places it in a folder of the user's choice. It then calls the PutAllResponsesInFolder sub.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim choice As String
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
choice = Inputbox( "Please enter a folder name:", _
"Which folder?" )
Call doc.PutInFolder( choice )
Call PutAllResponsesInFolder( doc, choice )
End Sub
The PutAllResponsesInFolder sub takes a parent document and a folder name, and places the responses and responses-to-responses of the parent document into the specified folder. The sub places each response to the parent document into the specified folder. For each response, the sub calls itself to place any responses to the response into the folder. This recursive behavior allows you to access every descendant of the parent document, no matter how many levels deep it is nested. If there are no responses, the sub exits.
Sub PutAllResponsesInFolder _
( doc As NotesDocument, folderName As String )
Dim collection As NotesDocumentCollection
Dim currentResponse As NotesDocument
Set collection = doc.Responses
Set currentResponse = collection.GetFirstDocument
' Put immediate responses to doc into the folder
' If there are none, sub exits and returns to calling sub
While Not ( currentResponse Is Nothing )
Call currentResponse.PutInFolder( folderName )
' Recursive call to put immediate responses to
' currentResponse in folder
Call PutAllResponsesInFolder _
( currentResponse, folderName )
Set currentResponse = collection.GetNextDocument _
( currentResponse )
Wend
End Sub
Instead of using the 'put in folder' you could modify this part to copy to database instead.